package cn.cvs.redisdemo.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class BookDao {
    @Autowired
    StringRedisTemplate stringRedisTemplate;

    public void  saveBook(String key,String value){
        stringRedisTemplate.opsForValue().set(key, value);
    }
    public String  getValue(String key){
       return stringRedisTemplate.opsForValue().get(key);
    }
}
